package com.learn.entity;

import lombok.AccessLevel;
import lombok.Data;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;

/**
 * @author zhangjianshan on 2021-05-01
 */
@FieldDefaults(level = AccessLevel.PRIVATE)
@Data
@RequiredArgsConstructor(staticName = "niu")
@Accessors(chain = true)
public class SysMenu implements Serializable {
    private static final long serialVersionUID = -7271439109972728146L;

    String menuId;

    String pid;

    String treeId;

    Long type;

    String title;

    String url;

    String permission;

    Integer id;

    String status;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SysMenu)) return false;

        SysMenu sysMenu = (SysMenu) o;

        return getTitle() != null ? getTitle().equals(sysMenu.getTitle()) : sysMenu.getTitle() == null;
    }

    @Override
    public int hashCode() {
        return getTitle() != null ? getTitle().hashCode() : 0;
    }
}
